package com.example.medicine.Mapper;


import com.example.medicine.Bean.zhongyao_zhengzhuang;
import org.apache.ibatis.annotations.*;

import java.util.List;


@Mapper
public interface zhongyao_zhengzhuangMapper {
    @Select("select * from [zhongyao_zhengzhuang]")
    List<zhongyao_zhengzhuang> getAll();

    @Select("select * from [zhongyao_zhengzhuang] where zhongyao=#{zhongyao}")
    List<zhongyao_zhengzhuang> getByZhongyao(int zhongyao);

    @Select("select * from [zhongyao_zhengzhuang] where zhengzhuang=#{zhengzhuang} and zhongyao=#{zhongyao}")
    List<zhongyao_zhengzhuang> getByZhengzhuang(zhongyao_zhengzhuang zhongyao_zhengzhuang);

    @Insert("insert into [zhongyao_zhengzhuang](zhongyao,zhengzhuang) values(#{zhongyao},#{zhengzhuang})")
    @Options(useGeneratedKeys = true,keyProperty = "id",keyColumn = "id")
    void insert(zhongyao_zhengzhuang zhongyao_zhengzhuang);

    @Update("update [zhongyao_zhengzhuang] set zhongyao=#{zhongyao},zhengzhuang=#{zhengzhuang} where id=#{id}")
    void update(zhongyao_zhengzhuang zhongyao_zhengzhuang);

    @Delete("delete from [zhongyao_zhengzhuang] where zhongyao=#{zhongyao}")
    void deleteByZhongyao(int zhongyao);
}
